package com.clf.tms.job;

import com.clf.tms.annotation.ElasticScheduler;
import com.clf.tms.utils.SpringUtil;
import com.clf.tms.job.service.StockSimpleService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import org.springframework.stereotype.Component;

@Component
@ElasticScheduler(cron = "0/30 * * * * ?", shardingTotalCount = 1, name = "测试注解", shardingItemParameters = "0=0,1=0,2=1,3=1")
public class StockSimpleJob implements SimpleJob {


    @Override
    public void execute(ShardingContext shardingContext) {
        StockSimpleService bean = SpringUtil.getBean(StockSimpleService.class);
        bean.test();
    }

}
